package utilities;

import java.sql.*;

public class JdbcMysqlConnectionUrl {

  static public final String driver = "com.mysql.jdbc.Driver";
  static public final String connection =
  "jdbc:mysql://127.0.0.1:3306/test" +
  "?user=root&password=toor&database=test";

  public static void main(String args[]) {

  try {
  Class.forName(driver);
  Connection con = DriverManager.getConnection(connection);
  
  System.out.println("Jdbc Mysql Connection Url :");
  System.out.println(connection);

  if (!con.isClosed()) {
  con.close();
  }

  } catch (Exception e) {
  e.printStackTrace();
  }
  }
}
